#ifndef ADDITEMS_H
#define ADDITEMS_H

#include <QObject>

class QGraphicsItem;
class QAction;

enum AddItem_e {
	eAddNone,
	eAddRect,
	eAddLine
};
class AddItems : public QObject
{
	Q_OBJECT

public:
	AddItems(QObject *parent = 0);
	~AddItems();

	QGraphicsItem * createRectItem();
	QGraphicsItem * createRectItemByDraw();
	QGraphicsItem * createLineItemByDraw();
	QGraphicsItem * createLineItemByConnect();

public slots:
	void addItemEvent();//(QObject *sender);
	
	bool getDrawRect(){ return mDrawRect; }

private:
	bool mDrawRect;
	void onDrawRect(bool b );

	QGraphicsItem * createItem(QAction * action);
	QGraphicsItem * createTextItem();
	QGraphicsItem * createLineItem();
	
};

extern AddItems *gAddItems;

#endif // ADDITEMS_H
